package com.ws.random;

public class RandomTest {

    public static void main(String[] args) {
        double value = Math.random(); //[0.0, 1.0)

        System.out.println(value);

        //获取一个随机数 10~99
        int num = (int) (value * 90 + 10);
        System.out.println(num);

        //公式：[a, b]   (int)(Math.random() * (b - a + 1) + a)
    }


}
